package com.yehangtech.designpattern.行为型_责任链模式;

import com.yehangtech.designpattern.行为型_责任链模式.entity.AuthInfo;
import com.yehangtech.designpattern.行为型_责任链模式.service.AbstractAuthLink;
import com.yehangtech.designpattern.行为型_责任链模式.service.Level1AuthLink;
import com.yehangtech.designpattern.行为型_责任链模式.service.Level2AuthLink;
import com.yehangtech.designpattern.行为型_责任链模式.service.Level3AuthLink;

import java.text.ParseException;
import java.util.Date;

public class Main {
    public static void main(String[] args) throws ParseException {
        AbstractAuthLink authLink = new Level3AuthLink("1000013", "王⼯")
                .appendNext(new Level2AuthLink("1000012", "张经理")
                        .appendNext(new Level1AuthLink("1000011", "段总")));
        AuthInfo authInfo = authLink.doAuth("岳云鹏", "1000998004813441", new Date());
        System.out.println(authInfo);
    }
}
